﻿@{
    ViewBag.Title = "ViewPage1";
    Layout = "~/Views/Shared/BaseView.cshtml";
}
<style type="text/css">
    .detailslist3
    {
        display: none;
    }
    .detailslist2
    {
        display: none;
    }
</style>
@{
    Common.Web.Cookie cookie = new Common.Web.Cookie();
    int visiterId = Convert.ToInt32(cookie.GetCookie("LoginUserId"));
    BenefitHelper.DB.DBManager db = new BenefitHelper.DB.DBManager();
    if (BenefitHelper.Sys.VisitPrower.HasAdminPrower(visiterId, db))
    { 
    <div id="buttons">
        <span>
            <p>
                <a href="/Init" target="_blank" title="后台管理">后台管理</a>
            </p>
        </span>
    </div>
    }
    db.Dispose();
}
<dl id="xiangmu">
    <dt><span id="title2">@ViewBag.op.UName</span></dt>
    <dd>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" id="panhoufenxi">
            <tr>
                <td id="curr_p">
                    <b class="panzhong"><a href="/OperatorRealtimeTransaction/Index/@ViewBag.queryuser/@ViewBag.datequery">
                        盘中分析</a></b><b><a>盘后分析</a></b>
                </td>
                <td style="border-left: 1px solid #ecc7b5;">
                    <a href="/AfterAnalysis/Index/@ViewBag.queryuser/@ViewBag.queryyear@ViewBag.querymonth">
                        <img src="/Content/images/icon_07.gif" />阶段总结</a>
                </td>
                <td>
                    <a href="/XingNeng/Index/@ViewBag.queryuser/@ViewBag.queryyear@ViewBag.querymonth">
                        <img src="/Content/images/icon_02.gif" />性能汇总</a>
                </td>
                <td class="selected">
                    <img src="/Content/images/icon_03.gif" />历史记录
                </td>
            </tr>
        </table>
    </dd>
</dl>
<div id="bigDataBox">
    <div class="date-select-bar">
        @for (int i = 1; i <= 12; i++)
        {
            if (!string.IsNullOrEmpty(ViewBag.querymonth.ToString()))
            {


                if (Convert.ToInt32(ViewBag.querymonth) == i)
                { 
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear@ViewBag.querymonth" class='cur'>@i</a>
                }
                else
                {
                    if (i < 10)
                    {
                        string z = "0" + i;
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear@z">@i</a>
                    }
                    else
                    {
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear@i">@i</a>
                    }

                }
            }
            else
            {
                if (i < 10)
                {
                    string z = "0" + i;
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear@z">@i</a>
                }
                else
                {
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear@i">@i</a>
                }

            }
        }
        @if (string.IsNullOrEmpty(ViewBag.querymonth.ToString()))
        {
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear" class='cur'>整年数据</a>
        }
        else
        {
            <a href="/StageSummary/Index/@ViewBag.queryuser/@ViewBag.queryyear">整年数据</a>
        }
    </div>
    <div class="date-select-bar" style="text-align: right; float: right;">
        @for (int i = 2011; i <= DateTime.Now.Year; i++)
        {
            if (Convert.ToInt32(ViewBag.queryyear) == i)
            {
            <a href="/AfterAnalysis/Index/@ViewBag.queryuser/@i@ViewBag.querymonth" class='cur'>@i</a>
            }
            else
            {
            <a href="/AfterAnalysis/Index/@ViewBag.queryuser/@i@ViewBag.querymonth">@i</a>
            }
        }
    </div>
    <br />
    <div style="height: 5px; line-height: 5px;">
    </div>
    <table style="width: 100%; height: 300px;">
        <tr>
            <td style="width: 66%; vertical-align: top;">
                <div style="width: 100%; height: 300px;" id="showflash">
                </div>
            </td>
            <td style="width: 34%; vertical-align: top;">
                <div style="width: 100%; height: 300px;" id="showflash2">
                </div>
            </td>
        </tr>
    </table>
    <div style="height: 5px; line-height: 5px;">
    </div>
    <div style="width: 60%; background-repeat: no-repeat; float: left; text-align: left;">
        <img src="/content/images/zijingzhuangkuang.png" />
    </div>
    <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
        <tr>
            <td style="text-align: center;" class="title">
            </td>
            <td style="text-align: center;" class="title">
                月初结存
            </td>
            <td style="text-align: center;" class="title">
                月末结存
            </td>
            <td style="text-align: center;" class="title">
                当月总入金
            </td>
            <td style="text-align: center;" class="title">
                当月总出金
            </td>
        </tr>
        @foreach (BenefitHelper.Data.Month.AccountMonthMoney money in ViewBag.operatorandaccountinfo)
        {
            if (money.AccountId == 0)
            {
            <tr id="ad" onclick="showDetail(7)" class="detailsold">
                <td class="bottomyes">
                    合计
                </td>
                <td class="bottomyes" style="text-align: right;">
                    @string.Format("{0:N2}", money.PresetTlePosit)
                </td>
                <td class="bottomyes" style="text-align: right;">
                    @string.Format("{0:N2}", money.SettlePosit)
                </td>
                <td class="bottomyes" style="text-align: right;">
                    @string.Format("{0:N2}", money.Deposit)
                </td>
                <td class="bottomyes leftyes" style="text-align: right;">
                    @string.Format("{0:N2}", money.WithDraw)
                </td>
            </tr>
            }
            else
            {
            <tr class="detailslist7">
                <td>
                    @money.Account.AccountName
                </td>
                <td style="text-align: right;">
                    @string.Format("{0:N2}", money.PresetTlePosit)
                </td>
                <td style="text-align: right;">
                    @string.Format("{0:N2}", money.SettlePosit)
                </td>
                <td style="text-align: right;">
                    @string.Format("{0:N2}", money.Deposit)
                </td>
                <td style="text-align: right;">
                    @string.Format("{0:N2}", money.WithDraw)
                </td>
            </tr>
            }

        }
    </table>
    <div style="height: 20px; line-height: 20px;">
    </div>
    <div>
        <div style="width: 60%; background-repeat: no-repeat; float: left; text-align: left;">
            <img src="/content/images/chengjiaogaikuang.png" />
        </div>
        <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
            <tr>
                <td style="text-align: center;" class="title">
                    <span>盈亏</span>
                </td>
                <td style="text-align: center;" class="title">
                    1个Tick
                </td>
                <td style="text-align: center;" class="title">
                    2个Tick
                </td>
                <td style="text-align: center;" class="title">
                    3个Tick
                </td>
                <td style="text-align: center;" class="title">
                    4个Tick
                </td>
                <td style="text-align: center;" class="title">
                    5个Tick
                </td>
                <td style="text-align: center;" class="title">
                    6个Tick
                </td>
                <td style="text-align: center;" class="title">
                    7个Tick
                </td>
                <td style="text-align: center;" class="title">
                    8个Tick
                </td>
                <td style="text-align: center;" class="title">
                    9个Tick
                </td>
                <td style="text-align: center;" class="title">
                    10个Tick
                </td>
                <td style="text-align: center;" class="title">
                    更多
                </td>
            </tr>
            <tr id="ad2" onclick="showDetail2()" title="点击查看更多">
                <td style="text-align: center;" class="down">
                    亏损
                </td>
                @for (int i = 0; i < ViewBag.loseticks.Count; i++)
                {
                    if (i == ViewBag.loseticks.Count - 1)
                    {
                    <td style="text-align: right;" class="leftyes">
                        @ViewBag.loseticks[i].Count 次
                    </td>
                    }
                    else
                    {
                    <td style="text-align: right;">
                        @ViewBag.loseticks[i].Count 次
                    </td>
                    }

                }
            </tr>
            <tr id="ad3" onclick="showDetail3()" title="点击查看更多">
                <td style="text-align: center;" class="raise bottomyes">
                    盈利
                </td>
                @for (int i = 0; i < ViewBag.winticks.Count; i++)
                {
                    if (i == ViewBag.winticks.Count - 1)
                    {
                    <td style="text-align: right;" class="bottomyes leftyes">
                        @ViewBag.winticks[i].Count 次
                    </td>
                    }
                    else
                    { 
                    <td style="text-align: right;" class="bottomyes">
                        @ViewBag.winticks[i].Count 次
                    </td>
                    }

                }
            </tr>
        </table>
        <div style="height: 20px; line-height: 20px;">
        </div>
        <div style="width: 60%; background-repeat: no-repeat; float: left; text-align: left;">
            <img src="/content/images/jiaoyitongji.png" />
        </div>
        <table cellspacing="0" cellpadding="0" class="list" style="width: 100%;">
            <tr>
                <td style="text-align: center;" class="title">
                    品种
                </td>
                <td style="text-align: center;" class="title">
                    多空
                </td>
                <td style="text-align: center;" class="title">
                    盈亏
                </td>
                <td style="text-align: center;" class="title">
                    手数
                </td>
                <td style="text-align: center;" class="title">
                    净利润
                </td>
                @*                <td style="text-align: center;" class="title">
                    平均单次利润
                </td>*@
                <td style="text-align: center;" class="title">
                    平均每手利润
                </td>
            </tr>
            @for (int i = 0; i < ViewBag.productinfos.Count; i++)
            {
                if (ViewBag.productinfos[i].ProductId.IndexOf("_") > 0)
                {
                    string s = "detailslist" + ViewBag.productinfos[i].ProductId.Replace("#", "");
                    if (i == ViewBag.productinfos.Count - 1)
                    {
                <tr class="@s" style="display:none;">
                    <td title="" class="bottomyes">
                        -
                    </td>
                    <td class="bottomyes">
                        @ViewBag.productinfos[i].Direction
                    </td>
                    <td class="bottomyes">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].Profit)
                    </td>
                    <td class="bottomyes" style="text-align: right;">
                        @ViewBag.productinfos[i].BillCount 手
                    </td>
                    <td class="bottomyes" style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].DayCount)
                    </td>
                    @*                    <td class="bottomyes" style="text-align: right;">
                        @(ViewBag.productinfos[i].SumWin / ViewBag.productinfos[i].WinCount)
                    </td>*@
                    <td class="bottomyes leftyes" style="text-align: right;">
                        @string.Format("{0:N2}", (ViewBag.productinfos[i].SumWin / ViewBag.productinfos[i].BillCount))
                    </td>
                </tr>
                    }
                    else
                    {
                <tr class="@s" style="display:none;">
                    <td title="">
                        -
                    </td>
                    <td>
                        @ViewBag.productinfos[i].Direction
                    </td>
                    <td style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].Profit)
                    </td>
                    <td style="text-align: right;">
                        @ViewBag.productinfos[i].BillCount 手
                    </td>
                    <td style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].DayCount)
                    </td>
                    @*                    <td>
                        @(ViewBag.productinfos[i].SumWin / ViewBag.productinfos[i].WinCount)
                    </td>*@
                    <td class="leftyes" style="text-align: right;">
                        @string.Format("{0:N2}", (ViewBag.productinfos[i].SumWin / ViewBag.productinfos[i].BillCount))
                    </td>
                </tr>
                    }

                }
                else
                {
                    string pid = ViewBag.productinfos[i].ProductId + "_1";
                    var query = ViewBag.productinfos.Count;
                    if (i != query - 7)
                    {
                <tr class="detailsold" onclick="showDetail('@pid')">
                    <td title="">
                        <b>@ViewBag.productinfos[i].ProductId</b>
                    </td>
                    <td>
                        @ViewBag.productinfos[i].Direction
                    </td>
                    <td style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].Profit)
                    </td>
                    <td style="text-align: right;">
                        @ViewBag.productinfos[i].BillCount 手
                    </td>
                    <td style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].DayCount)
                    </td>
                    <td class="leftyes" style="text-align: right;">
                        @string.Format("{0:N2}", (ViewBag.productinfos[i].SumWin / ViewBag.productinfos[i].BillCount))
                    </td>
                </tr>
                    }
                    else
                    {
                <tr class="detailsold" onclick="showDetail4('@pid')">
                    <td title="" class="bottomyes lasttr">
                        <b>@ViewBag.productinfos[i].ProductId</b>
                    </td>
                    <td class="bottomyes lasttr">
                        @ViewBag.productinfos[i].Direction
                    </td>
                    <td class="bottomyes lasttr" style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].Profit)
                    </td>
                    <td class="bottomyes lasttr" style="text-align: right;">
                        @ViewBag.productinfos[i].BillCount 手
                    </td>
                    <td class="bottomyes lasttr" style="text-align: right;">
                        @string.Format("{0:N2}", ViewBag.productinfos[i].DayCount)
                    </td>
                    <td class="bottomyes leftyes lasttr" style="text-align: right;">
                        @string.Format("{0:N2}", (ViewBag.productinfos[i].SumWin / ViewBag.productinfos[i].BillCount))
                    </td>
                </tr>
                    }
                }


            }
        </table>
        <div style="height: 5px; line-height: 5px;">
        </div>
        <div style="height: 5px; line-height: 5px;">
        </div>
    </div>
    <div class="report-tip">
        <div class="report-tip-text">
            <div>
                <b>功能说明：</b></div>
            <div>
                亏损性成交：相对于当前（统计时间显示的时间）股票价格，在所有当日已经的成交中对于买入用户处于亏损的成交分布。<br />
                获利性成交：相对于当前（统计时间显示的时间）股票价格，在所有当日已经的成交中对于买入用户处于获利的成交分布。<br />
                成交均价：所有处于亏损或获利的不同成交单子中进行统计，平均成交价格。</div>
        </div>
        <div class="report-tip-close">
            &nbsp;</div>
        <div class="report-tip-text">
            <div>
                <b>使用帮助：</b></div>
            <div>
                本内容主要是将大小单成交与获利与亏损结合起来，以便于用户可以通过分析来获取有利于交易的市场交易习惯和潜在交易机会。</div>
        </div>
        <div class="report-tip-text">
            <div>
                <b>数据更新：</b></div>
            <div>
                盘中数据动态更新，更新间隔5分钟，由于运算因素，实时成交数据整体延时约5-10分钟。</div>
        </div>
    </div>
</div>
@MvcHtmlString.Create(ViewBag.js)
<script type="text/javascript">
    YearBenefit();
    YearBar();
    function showorhidden() {
        if ($('#ad').attr('class') == "detailsold") {
            $("#ad").removeClass("detailsold").addClass("detailsoldclick");
        } else {
            $("#ad").removeClass("detailsoldclick").addClass("detailsold");
        }
        $(".detailslist").toggle();

    }
    function showa() {
        $(".detailslist").toggle();
    }
    function showDetail(id) {
        if ($('#ad').attr('class') == "detailsold" + id) {
            $("#ad").removeClass("detailsold" + id).addClass("detailsoldclick" + id);
            // alert("1");
        } else {
            $("#ad").removeClass("detailsoldclick" + id).addClass("detailsold" + id);
            //   alert("2");
        }
        $(".detailslist" + id).toggle();

    }
    function showDetail4(id) {
        if ($('#ad').attr('class') == "detailsold" + id) {
            $("#ad").removeClass("detailsold" + id).addClass("detailsoldclick" + id);
            // alert("1");
        } else {
            $("#ad").removeClass("detailsoldclick" + id).addClass("detailsold" + id);
            //   alert("2");
        }
        $(".detailslist" + id).toggle();
        $(".lasttr").each(function () {
            if ($(this).attr("class").toString().indexOf("bottom") >= 0) {
                $(this).removeClass("bottomyes");
            } else {
                $(this).addClass("bottomyes");
            }
        });
        //   alert($(".lasttr")[0].css("display"));
    }
    function showDetail2() {
        if ($('#ad').attr('class') == "detailsold") {
            $("#ad").removeClass("detailsold").addClass("detailsoldclick");
        } else {
            $("#ad").removeClass("detailsoldclick").addClass("detailsold");
        }
        $(".detailslist2").toggle();
    }
    function showDetail3() {
        if ($('#ad').attr('class') == "detailsold") {
            $("#ad").removeClass("detailsold").addClass("detailsoldclick");
        } else {
            $("#ad").removeClass("detailsoldclick").addClass("detailsold");
        }
        $(".detailslist3").toggle();
    }
</script>
